angular.module('meMyIntegratDetailServices', [])

  .factory('MyIntegratDetail', function ($resource, $rootScope, ENV) {

    //设置访问接口路径
    var APIUrl = ENV.api;

    //访问获取用户信息的接口
    var mePointDetailResource = $resource(APIUrl + "my-integrat/getMePointDetail.do");

    var myPointDetailJson;

    return {

      getMyIntegrateDetail : function(memberId){
        mePointDetailResource.save(
          {member_id : memberId},
          function(data){
            myPointDetailJson = data;
            $rootScope.$broadcast('Me.MyIntegratDetail');
          }
        );
      },

      getMyIntegrateDetailJson : function(){
        return myPointDetailJson;
      }

    }
  });
